package org.megha.blog.example.part18;

/**
 * A Circle of a given radius.
 * 
 * @author Megha Birmiwal
 */
public class Circle implements Shape {

	private final double pi = Math.PI;
	private final double radius;

	/** creates a circle of the given dimension */
	public Circle(double radius) {
		this.radius = radius;
	}

	@Override
	public double getArea() {
		return pi * radius * radius;
	}

	@Override
	public double getPerimeter() {
		return 2 * pi * radius;
	}

	public double getRadius() {
		return radius;
	}
}
